package com.shared.server.impl;

import com.shared.dao.PUserMapper;
import com.shared.pojo.PUser;
import com.shared.server.PUserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PUserServerImpl implements PUserServer {
    @Autowired
    private PUserMapper pUserMapper;
    @Override
    public List<PUser> findUserByPhone(String phone) {
        return pUserMapper.findUserByPhone(phone);
    }

    @Override
    public void updateUserPicByPhone(Integer id, String portrait) {
        this.pUserMapper.updateUserPicByPhone(id, portrait);
    }
    @Override
    public PUser update(PUser pUser) {
        this.pUserMapper.update(pUser);
        return this.pUserMapper.queryById(pUser.getId());
    }

    @Override
    public List<PUser> findUser(Object id) {
        return pUserMapper.findById(id);
    }
}
